package com.lxq.dataStructure.linkList;

public class Student {
    private String name;
    private int score;

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }


    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

    public static void main(String[] args) {
        linkList<Student> lList = new linkList<>();
        lList.initLinkList();
        Student s1 = new Student("s1",47);
        Student s2 = new Student("s2",98);
        Student s3 = new Student("s3",15);
        Student s4 = new Student("s4",54);
        Student s5 = new Student("s5",54);
        Student s6 = new Student("s6",90);
        Student s7 = new Student("s7",354);
        lList.addHead(s1);
        System.out.println(lList);
        lList.delete(s1);
        System.out.println(lList);
        lList.addHead(s2);
        System.out.println(lList);
        lList.addLast(s3);
        System.out.println(lList);
        lList.addLast(s4);
        System.out.println(lList);
        lList.delete(s3);
        System.out.println(lList);
        lList.addHead(s5);
        System.out.println(lList);
        lList.delete(s4);
        System.out.println(lList);
        lList.addLast(s6);
        System.out.println(lList);
        lList.update(s2,s7);
        System.out.println(lList);
        lList.addLast(s7);
        System.out.println(lList);
        lList.delete(s7);
        System.out.println(lList);
        lList.deleteLast();
        System.out.println(lList);
        lList.deleteHead();
        System.out.println(lList);
        System.out.println(lList.find(s4));
        System.out.println(lList.find(s2));
    }
}
